<?php
/**
 * Created by PhpStorm.
 * User: yangfan
 * Date: 2019/11/12
 * Time: 10:23 AM
 */

namespace App\Entities;

class UserAddressEntity extends ABaseEntity
{
    /**
     * @var string
     */
    private $orderAddress;

    public function __construct(UserAddressModel $model)
    {
        $this->model = $model;
    }

    /**
     * @return int
     */
    public function getId()
    {
        return $this->model->id;
    }

    /**
     * 用户ID
     *
     * @return int
     */
    public function getUserId()
    {
        return $this->model->user_id;
    }

    /**
     * 用户ID
     */
    public function setUserId(int $userId)
    {
        $this->model->user_id = $userId;
    }

    /**
     * @return string
     */
    public function getContactName()
    {
        return $this->model->contact_name;
    }

    /**
     * @return string
     */
    public function getContactPhone()
    {
        return $this->model->contact_phone;
    }

    /**
     * model 不存在
     * @return string
     */
    public function getFullAddress()
    {
        return $this->model->full_address;
    }

    /**
     * @return int
     */
    public function getCityId()
    {
        return $this->model->cityid;
    }

    /**
     * @return int
     */
    public function getProvinceId()
    {
        return $this->model->provinceid;
    }

    /**
     * @param string $contactName
     */
    public function setContactName(string $contactName): void
    {
        $this->model->contact_name = $contactName;
    }

    /**
     * @param string $contactPhone
     */
    public function setContactPhone(string $contactPhone): void
    {
        $this->model->contact_phone = $contactPhone;
    }

    /**
     * @param int $cityId
     */
    public function setCityId(int $cityId): void
    {
        $this->model->cityid = $cityId;
    }

    /**
     * @param int $provinceId
     */
    public function setProvinceId(int $provinceId): void
    {
        $this->model->provinceid = $provinceId;
    }

    /**
     * @return string
     */
    public function getOrderAddress(): string
    {
        return $this->orderAddress;
    }

    /**
     * @param string $orderAddress
     */
    public function setOrderAddress(string $orderAddress): void
    {
        $this->orderAddress = $orderAddress;
    }

    /**
     * @return int
     */
    public function getIsdefault(): int
    {
        return (int)$this->model->isdefault;
    }
}
